﻿@using InfoTech.VinhSon.Bussiness
@model InfoTech.VinhSon.Bussiness.Article
@{
    ViewBag.Title = Model.Name;
    Layout = "~/Views/Shared/_1Column.cshtml";
}
@section css
{
    <link href="@Url.Content("~/scripts/ad-galerry/jquery.ad-gallery.css")" rel="stylesheet" type="text/css" />
    <style>
        #gallery
        {
            width: 850px;
            padding: 20px;
            margin: 0 auto;
        }
        .ad-image
        {
            margin: 0 20px 15px 0;
            border: 5px solid #fff;
            -webkit-box-shadow: 1px 1px 2px #e6e6e6;
            -moz-box-shadow: 1px 1px 2px #e6e6e6;
            box-shadow: 5px 5px 10px #e6e6e6;
        }
        .main
        {
            padding: 20px;
        }
        .main .article_title1
        {
            text-align: center;
        }
        .same-category-title
        {
            margin-top: 20px;
            font-size: 16px;
            text-align: center;
            color: #6c3403;
        }
        .same-category-list
        {
            margin-left: 350px;
            margin-right: 50px;
        }
        .same-category-list li
        {
            list-style: square;
            margin: 5px;
        }
        .same-category-list li a
        {
            text-decoration: none;
            color: #0377BA;
            font-size: 13px;
        }
        .same-category-list li a:hover
        {
            text-decoration: underline;
            color: #6c3403;
        }
        .line-seperator
        {
            width: 300px;
            margin: 0 auto;
            border-bottom: 1px dotted #ccc;
        }
    </style>
}
@section script
{
    <script src="@Url.Content("~/scripts/ad-galerry/jquery.ad-gallery.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $('.ad-gallery').adGallery({
                loader_image: '@Url.Content("~/scripts/ad-galerry/loader.gif")'
            });
        });
    </script>
}
<div class="main">
    <div class="article_category_title1">
        <a href="@Model.Category.GetUrl()">@Model.Category.Name </a>
    </div>
    <div class="seperator1">
    </div>
    <div class="article_title1">
        @Model.Name
    </div>
    @Html.Raw(Model.Detail)
    <div class="clear">
    </div>
    @{
        if (Model.Sections.Any())
        {
        <div id="gallery" class="ad-gallery">
            <div class="ad-image-wrapper">
            </div>
            <div class="ad-controls">
            </div>
            <div class="ad-nav">
                <div class="ad-thumbs">
                    <ul class="ad-thumb-list">
                        @{
            foreach (Section item in Model.Sections.OrderBy(c => c.Priority))
            {
                            <li><a href="/Resource/Images/@item.Url">
                                <img src="/Resource/Images/thumb_@(item.Url)" title="" alt="">
                            </a></li>
            }
                        }
                    </ul>
                </div>
            </div>
        </div>
        }
    }
</div>
@{
    List<Article> q0 = (List<Article>)ViewBag.CategoryArticles;
    if (q0 != null)
    {
        if (q0.Any())
        {
    <div class="same-category-title">
        BÀI VIẾT CÙNG CHỦ ĐỀ</div>
    <div class="line-seperator">
    </div>
    <ul class="same-category-list">
        @{
            foreach (Article item in q0)
            {
            <li><a href="@item.GetUrl()" title="@item.Description">@item.Name (@string.Format("{0:dd/MM/yyyy HH:mm}", item.LastModified))</a></li>
            }
        }
    </ul>            
        }
    }
}
